#ifndef MQTT_HANDLER_H
#define MQTT_HANDLER_H

#include <MQTTClient.h>

#define MQTT_ADDRESS   "tcp://192.168.43.224:1883"
#define CLIENTID       "GatewayClient"
#define QOS            1
#define TIMEOUT        10000L

// MQTT初始化
void mqtt_init(MQTTClient* client, MQTTClient_messageArrived* msgarrvd);
// 发布消息
void mqtt_publish(MQTTClient client, const char* topic, const char* payload);
// 订阅主题
void mqtt_subscribe(MQTTClient client, const char* topic);
// 清理MQTT
void mqtt_cleanup(MQTTClient client);

#endif